Learn R Programming

phonR (version 1.0-1)

Repulsive force: Repulsive force calculations and plots for vowel systems.

Description

For each point, calculates the sum of inverse squared distances to all points that are not of the same type.

Usage

repulsiveForce(x, y, type, xform=log, exclude.inf=TRUE)
    repulsiveForceHeatmap(x, y, type=NULL, xform=log, 
                          exclude.inf=TRUE, resolution=10,
                          colormap=NULL, fast=FALSE, ...)
    repulsiveForceHeatmapLegend(x, y, labels=c("low", "high"),
                                pos=c(1, 3), colormap=NULL,
                                smoothness=50, lend=2, lwd=12, ...)

Arguments

Value

repulsiveForce returns the sum of the repulsive forces calculated at each point (x,y).

Details

Given endpoints x and y, forceHeatmapLegend draws a colorbar legend with smoothness number of steps using the provided colormap (or defaults to grayscale if colormap is NULL.

References

Liljencrants, J., & Lindblom, B. 1972 Numerical simulation of vowel quality systems: The role of perceptual contrast. Language, 48(4), 839-862. http://www.jstor.org/stable/411991

McCloy, D. R., Wright, R. A., & Souza, P. E. 2014 Talker versus dialect effects on speech intelligibility: A symmetrical study. Language and Speech. http://dx.doi.org/10.1177/0023830914559234

Pineda, J. 1988 A parallel algorithm for polygon rasterization. ACM SIGGRAPH Computer Graphics, 22(4), 17-20. http://dx.doi.org/10.1145/378456.378457

See Also

plotVowels

Examples

Run this code
require(plotrix)
    data(indoVowels)
    force <- with(indo[indo$subj==indo$subj[1],], 
                  repulsiveForce(f2, f1, vowel))
    colmap <- color.scale(x=0:100, cs1=c(0, 180), cs2=100, 
                          cs3=c(25, 100), color.spec='hcl')
    with(indo[indo$subj==indo$subj[1],],
        repulsiveForceHeatmap(f2, f1, type=vowel, resolution=10,
                              colormap=colmap, add=FALSE))
    xl <- rep(max(range(indo$f2)), 2)
    yl <- range(indo$f1) + c(abs(diff(range(indo$f1)) / 2), 0)
    repulsiveForceHeatmapLegend(xl, yl, colormap=colmap, useRaster=TRUE)

Run the code above in your browser using DataLab